package main

import "fmt"

type Address struct {
	Name  string
	Phone int
}

// 空接口和 类型断言使用细节
func main() {

	// 创建一个map
	m := make(map[string]interface{})
	m["username"] = "张三"
	m["age"] = 12
	m["hobby"] = []string{"睡觉", "打游戏"}

	a := Address{
		Name:  "李四",
		Phone: 123123323212,
	}
	m["address"] = a

	hobby, _ := m["hobby"].([]string)
	fmt.Println(hobby)

	address, _ := m["address"].(Address)
	fmt.Println(address)
}
